#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/ShipInit.hpp"

#include "2s2h/Rando/Logic/Logic.h"

using namespace Rando::Logic;

// clang-format off
static RegisterShipInitFunc initFunc([]() {
	Regions[RR_MISCELLANEOUS] = RandoRegion{ .name = "Various Regions", .sceneId = SCENE_SPOT00,
		.checks = {
			CHECK(RC_ENEMY_DROP_ARMOS,			CanKillEnemy(ACTOR_EN_AM)			&& CanReachRegions({ RR_STONE_TOWER_TEMPLE_ARMOS_ROOM })),
			CHECK(RC_ENEMY_DROP_BEAMOS,			CanKillEnemy(ACTOR_EN_VM)			&& CanReachRegions({ RR_STONE_TOWER_BOTTOM,
																										 RR_STONE_TOWER_MIDDLE,
																										 RR_STONE_TOWER_TEMPLE_SHALLOW_POOL_ROOM })),
			CHECK(RC_ENEMY_DROP_BLUE_BUBBLE,	CanKillEnemy(ACTOR_EN_BB)			&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_ROAD_TO_IKANA_FIELD_SIDE,
																										 RR_ROAD_TO_IKANA_BELOW_LEDGE,
																										 RR_IKANA_CASTLE_BUBBLE_ROOM,
																										 RR_STONE_TOWER_TEMPLE_INVERTED_PATH_TO_GOMESS })),
			CHECK(RC_ENEMY_DROP_BIO_DEKU_BABA,	CanKillEnemy(ACTOR_BOSS_05)			&& CanReachRegions({ RR_TERMINA_FIELD_BIO_BABA_GROTTO,
																										 RR_STONE_TOWER_TEMPLE_DEEP_POOL_ROOM,
																										 RR_GREAT_BAY_TEMPLE_COMPASS_ROOM,
																										 RR_GREAT_BAY_TEMPLE_BABA_CHEST_ROOM })),
			CHECK(RC_ENEMY_DROP_BOMBCHU,		CanKillEnemy(ACTOR_EN_RAT)			&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_ROAD_TO_IKANA_FIELD_SIDE,
																										 RR_ROAD_TO_IKANA_BELOW_LEDGE })),
			CHECK(RC_ENEMY_DROP_CHU,			CanKillEnemy(ACTOR_EN_SLIME)		&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_ROAD_TO_SOUTHERN_SWAMP,
																										 RR_GREAT_BAY_TEMPLE_BEFORE_WART,
																										 RR_GREAT_BAY_TEMPLE_GREEN_PIPE_3,
																										 RR_STONE_TOWER_TEMPLE_INVERTED_BLOCK_FLIP_ROOM })),
			CHECK(RC_ENEMY_DROP_DEATH_ARMOS,	CanKillEnemy(ACTOR_EN_FAMOS)		&& CanReachRegions({ RR_STONE_TOWER_TEMPLE_INVERTED_SIDE_OF_ENTRANCE,
																										 RR_STONE_TOWER_TEMPLE_INVERTED_POE_ROOM })),
			CHECK(RC_ENEMY_DROP_DEKU_BABA,		CanKillEnemy(ACTOR_EN_DEKUBABA)		&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_ROAD_TO_SOUTHERN_SWAMP,
																										 RR_SOUTHERN_SWAMP_NEAR_WOODS,
																										 RR_WOODFALL_TEMPLE_MAIN_ROOM, 
																										 RR_WOODFALL_TEMPLE_MAZE_ROOM,
																										 RR_BENEATH_THE_WELL_BABA_AND_POTS_ROOM,
																										 RR_SAKON_HIDEOUT })),
			CHECK(RC_ENEMY_DROP_DODONGO,		CanKillEnemy(ACTOR_EN_DODONGO)		&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_TERMINA_FIELD_DODONGO_GROTTO })),
			CHECK(RC_ENEMY_DROP_DRAGONFLY,		CanKillEnemy(ACTOR_EN_GRASSHOPPER)	&& CanReachRegions({ RR_SOUTHERN_SWAMP_SOUTH_UPPER,
																										 RR_WOODFALL,
																										 RR_STONE_TOWER_TEMPLE_ENTRANCE,
																										 RR_STONE_TOWER_TEMPLE_OUTSIDE_SWITCH_ROOM,
																										 RR_WOODFALL_TEMPLE_PRE_BOSS_ROOM,
																										 RR_WOODFALL_TEMPLE_COMPASS_ROOM,
																										 RR_WOODFALL_TEMPLE_MAIN_ROOM_UPPER })),
			CHECK(RC_ENEMY_DROP_EENO,			CanKillEnemy(ACTOR_EN_SNOWMAN)		&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_SNOWHEAD_TEMPLE_SNOW_ROOM })),
			// Flying pots have unreachable drop logic. Excluding for now, pending rework to expand enemy drops
			// CHECK(RC_ENEMY_DROP_FLYING_POT,		CanKillEnemy(ACTOR_EN_TUBO_TRAP)	&& CanReachRegions({ RR_STONE_TOWER_TEMPLE_INVERTED_UNDER_BRIDGE, RR_SNOWHEAD_TEMPLE_BLOCK_ROOM })),
			CHECK(RC_ENEMY_DROP_FLOORMASTER,	CanKillEnemy(ACTOR_EN_FLOORMAS)		&& CanReachRegions({ RR_IKANA_CASTLE_FLOORMASTER_ROOM })),
			// Freezards change their category before dying. Excluding for now, pending rework to expand enemy drops
			// CHECK(RC_ENEMY_DROP_FREEZARD,		CanKillEnemy(ACTOR_EN_FZ)			&& CanReachRegions({ RR_SNOWHEAD_TEMPLE_BRIDGE_ROOM_AFTER, RR_SNOWHEAD_TEMPLE_MAP_ROOM_UPPER, RR_SNOWHEAD_TEMPLE_PILLARS_ROOM_UPPER, RR_BENEATH_THE_WELL_FREEZARD_ROOM })),
			CHECK(RC_ENEMY_DROP_GUAY,			CanKillEnemy(ACTOR_EN_CROW)			&& CanReachRegions({ RR_IKANA_CANYON_UPPER,
																										 RR_IKANA_CASTLE_COURTYARD,
																										 RR_STONE_TOWER_TEMPLE_OUTSIDE_SWITCH_ROOM }) ||
																					  (CanReachRegions({ RR_MOUNTAIN_VILLAGE,
																									     RR_PATH_TO_GORON_VILLAGE }) &&
																										 RANDO_EVENTS[RE_CLEARED_SNOWHEAD_TEMPLE]) ||
																					  (CanReachRegions({ RR_ZORA_CAPE_OUTSIDE_FAIRY_FOUNTAIN }))),
			CHECK(RC_ENEMY_DROP_HIPLOOP,		CanKillEnemy(ACTOR_EN_PP)			&& CanReachRegions({ RR_WOODFALL,
																										 RR_STONE_TOWER_TEMPLE_INVERTED_WIND_ROOM,
																										 RR_STONE_TOWER_TEMPLE_SPIKED_BAR_ROOM_UPPER })),
			CHECK(RC_ENEMY_DROP_IRON_KNUCKLE,	CanKillEnemy(ACTOR_EN_IK)			&& CanReachRegions({ RR_BENEATH_THE_GRAVEYARD_NIGHT_1_BOSS,
																										 RR_BENEATH_THE_GRAVEYARD_NIGHT_2_BOSS,
																										 RR_MOON_LINK_TRIAL })),
			CHECK(RC_ENEMY_DROP_KEESE,			CanKillEnemy(ACTOR_EN_FIREFLY)		&& CanReachRegions({ RR_STONE_TOWER_TOP,
																										 RR_STONE_TOWER_UPPER,
																										 RR_STONE_TOWER_MIDDLE,
																										 RR_BENEATH_THE_WELL_LEFT_FIRE_KEESE,
																										 RR_BENEATH_THE_WELL_RIGHT_FIRE_KEESE,
																										 RR_BENEATH_THE_WELL_FREEZARD_ROOM,
																										 RR_BENEATH_THE_GRAVEYARD_NIGHT_2_GRAVE_BEFORE_PIT,
																										 RR_SNOWHEAD_NEAR_TEMPLE,
																										 RR_PATH_TO_SNOWHEAD_LOWER,
																										 RR_PATH_TO_SNOWHEAD_MIDDLE })),
			CHECK(RC_ENEMY_DROP_LEEVER,			CanKillEnemy(ACTOR_EN_NEO_REEBA)	&& CanReachRegions({ RR_TERMINA_FIELD,
																										 RR_GREAT_BAY_COAST,
																										 RR_ZORA_CAPE })),
			CHECK(RC_ENEMY_DROP_LIKE_LIKE,		CanKillEnemy(ACTOR_EN_RR)			&& CanReachRegions({ RR_ZORA_CAPE,
																										 RR_GREAT_BAY_COAST })),
			CHECK(RC_ENEMY_DROP_MAD_SCRUB,		CanKillEnemy(ACTOR_EN_DEKUNUTS)		&& CanReachRegions({ RR_WOODFALL,
																										 RR_DEKU_PALACE_INSIDE_UPPER })),
			CHECK(RC_ENEMY_DROP_MINI_BABA,		CanKillEnemy(ACTOR_EN_KAREBABA)		&& CanReachRegions({ RR_SOUTHERN_SWAMP_NORTH,
																										 RR_SOUTHERN_SWAMP_NEAR_WOODS,
																										 RR_DEKU_PALACE_OUTSIDE,
																										 RR_BENEATH_THE_WELL_BABA_AND_POTS_ROOM,
																										 RR_GREAT_BAY_COAST_FISHERMAN_GROTTO,
																										 RR_IKANA_CANYON_GROTTO,
																										 RR_IKANA_GRAVEYARD_GROTTO,
																										 RR_MOUNTAIN_VILLAGE_TUNNEL_GROTTO,
																										 RR_PATH_TO_GORON_VILLAGE_RAMP_GROTTO,
																										 RR_PATH_TO_SNOWHEAD_GROTTO,
																										 RR_ROAD_TO_IKANA_GROTTO,
																										 RR_ROAD_TO_SOUTHERN_SWAMP_GROTTO,
																										 RR_SOUTHERN_SWAMP_GROTTO,
																										 RR_TERMINA_FIELD_PILLAR_GROTTO,
																										 RR_TERMINA_FIELD_TALL_GRASS_GROTTO,
																										 RR_WOODS_OF_MYSTERY_GROTTO,
																										 RR_ZORA_CAPE_GROTTO })),
			CHECK(RC_ENEMY_DROP_NEJIRON,		CanKillEnemy(ACTOR_EN_BAGUO)		&& CanReachRegions({ RR_ROAD_TO_IKANA_ABOVE_LEDGE,
																										 RR_STONE_TOWER_TEMPLE_MIRROR_PILLAR_ROOM })),
			CHECK(RC_ENEMY_DROP_OCTOROK,		CanKillEnemy(ACTOR_EN_OKUTA)		&& CanReachRegions({ RR_SOUTHERN_SWAMP_NEAR_FLOWERS,
																										 RR_GREAT_BAY_TEMPLE_RED_PIPE_BEFORE_WART,
																										 RR_IKANA_CANYON_LOWER })),
			CHECK(RC_ENEMY_DROP_PEAHAT,			CanKillEnemy(ACTOR_EN_PEEHAT)		&& CanReachRegions({ RR_TERMINA_FIELD_PEAHAT_GROTTO })),
			CHECK(RC_ENEMY_DROP_RED_BUBBLE,		CanKillEnemy(ACTOR_EN_BBFALL)		&& CanReachRegions({ RR_SNOWHEAD_TEMPLE_CENTRAL_ROOM_BOTTOM })),
			CHECK(RC_ENEMY_DROP_REDEAD,			CanKillEnemy(ACTOR_EN_RD)			&& CanReachRegions({ RR_IKANA_CASTLE_FRONT_ENTRANCE,
																										 RR_IKANA_CASTLE_REDEAD_WALKWAY,
																										 RR_IKANA_CASTLE_FLOORMASTER_ROOM_REDEAD_AREA,
																										 RR_STONE_TOWER_UPPER, })),
			CHECK(RC_ENEMY_DROP_SHELLBLADE,		CanKillEnemy(ACTOR_EN_SB)			&& CanReachRegions({ RR_PIRATES_FORTRESS_LEFT_CLAM_EGG_ROOM,
																										 RR_PIRATES_FORTRESS_RIGHT_CLAM_EGG_ROOM,
																										 RR_PIRATES_FORTRESS_CAPTAIN_ROOM,
																										 RR_GREAT_BAY_TEMPLE_RED_PIPE_BEFORE_WART })),
			CHECK(RC_ENEMY_DROP_SKULLFISH,		CanKillEnemy(ACTOR_EN_PR2)			&& CanReachRegions({ RR_GREAT_BAY_TEMPLE_MAP_ROOM,
																										 RR_GREAT_BAY_TEMPLE_RED_PIPE_BEFORE_WART })),
			CHECK(RC_ENEMY_DROP_SKULLTULA,		CanKillEnemy(ACTOR_EN_ST)			&& (CanReachRegions({ RR_ASTRAL_OBSERVATORY_PASSAGE,
																										 RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_1,
																										 RR_WOODFALL_TEMPLE_ENTRANCE,
																										 RR_WOODFALL_TEMPLE_MAZE_ROOM,
																										 RR_LONE_PEAK_SHRINE,
																										 RR_OCEAN_SPIDER_HOUSE_STORAGE_ROOM,
																										 RR_OCEAN_SPIDER_HOUSE_MEETING_ROOM,
																										 RR_GREAT_BAY_TEMPLE_WATER_WHEEL_ROOM,
																										 RR_BENEATH_THE_WELL_SKULLTULA_ROOM,
																										 RR_BENEATH_THE_WELL_FOUR_SPIKED_BARS,
																										 RR_BENEATH_THE_GRAVEYARD_NIGHT_1_GRAVE,
																										 RR_IKANA_CASTLE_SKULLTULA_ROOM }) ||
																						CanReachRegions({ RR_WOODFALL_TEMPLE_PRE_BOSS_ROOM }) && CAN_BE_DEKU)),
			CHECK(RC_ENEMY_DROP_SKULLWALLTULA,	CanKillEnemy(ACTOR_EN_SW)			&& CanReachRegions({ RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_1 })),
			CHECK(RC_ENEMY_DROP_SNAPPER,		CanKillEnemy(ACTOR_EN_KAME)			&& CanReachRegions({ RR_WOODS_OF_MYSTERY,
																										 RR_WOODFALL_TEMPLE_MAP_ROOM })),
			CHECK(RC_ENEMY_DROP_STALCHILD,		CanKillEnemy(ACTOR_EN_SKB)			&& CanReachRegions({ RR_IKANA_GRAVEYARD_LOWER,
																										 RR_IKANA_GRAVEYARD_UPPER })),
			CHECK(RC_ENEMY_DROP_TEKTITE,		CanKillEnemy(ACTOR_EN_TITE)			&& CanReachRegions({ RR_GORON_VILLAGE,
																										 RR_PATH_TO_MOUNTAIN_VILLAGE_LOWER,
																										 RR_PATH_TO_GORON_VILLAGE,
																										 RR_GREAT_BAY_TEMPLE_GREEN_PIPE_1 })),
			CHECK(RC_ENEMY_DROP_WOLFOS,			CanKillEnemy(ACTOR_EN_WF)			&& CanReachRegions({ RR_ROAD_TO_SOUTHERN_SWAMP,
																										 RR_PATH_TO_GORON_VILLAGE,
																										 RR_SNOWHEAD_NEAR_TEMPLE,
																										 RR_SNOWHEAD_TEMPLE_ENTRANCE_AFTER_BLOCK,
																										 RR_SNOWHEAD_TEMPLE_COMPASS_ROOM,
																										 RR_SAKON_HIDEOUT })),
			CHECK(RC_ENEMY_DROP_WALLMASTER,		CanKillEnemy(ACTOR_EN_WALLMAS)		&& CanReachRegions({ RR_BENEATH_THE_GRAVEYARD_DAMPE,
																										 RR_BENEATH_THE_WELL_FREEZARD_ROOM,
																										 RR_BENEATH_THE_WELL_LEFT_FIRE_KEESE,
																										 RR_BENEATH_THE_WELL_FOUR_SPIKED_BARS,
																										 RR_BENEATH_THE_WELL_TWO_SPIKED_BARS })),
		},
	};
}, {});
// clang-format on